package org.takeback.chat.service;

import java.util.List;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.takeback.chat.entity.LHHNumDetail;
import org.takeback.service.BaseService;
@Service("lhhNumDetailService")
public class LHHNumDetailService extends BaseService{

	@Transactional
	public Integer getLhhNum() {
		String hql = "from LHHNumDetail order by id desc";
		List<LHHNumDetail> lhh = this.findByHql(hql, null, 0, 1);
		if(lhh == null || lhh.size() == 0) {
			return 1;
		}
		return lhh.get(0).getId();
	}
	
	@Transactional
	public List<LHHNumDetail> getLhhNumdDetailByPage(Integer pageSize, Integer pageNo) {
		String hql = "from LHHNumDetail order by id desc";
		List<LHHNumDetail> lhh = this.findByHql(hql, null, pageSize, pageNo);
		
		return lhh;
	}
	
}
